<?php
namespace Amis\form;
class InputTag extends FormItem
{
    public string $type = 'input-tag';

    public function options($options)
    {
        $this->options = $options;
        return $this;
    }

    public function source($api)
    {
        $this->source = $api;
        return $this;
    }

    /**
     * @param bool $delimiter
     * @return $this
     */
    public function delimiter(bool $delimiter = false)
    {
        $this->delimiter = $delimiter;
        return $this;
    }

    public function labelField(string $labelField = 'label')
    {
        $this->labelField = $labelField;
        return $this;
    }

    public function valueField(string $valueField = 'value')
    {
        $this->valueField = $valueField;
        return $this;
    }

    public function joinValues(bool $joinValues = true)
    {
        $this->joinValues = $joinValues;
        return $this;
    }

    public function extractValue(bool $extractValue = false)
    {
        $this->extractValue = $extractValue;
        return $this;
    }

    public function clearable(bool $clearable = false)
    {
        $this->clearable = $clearable;
        return $this;
    }

    public function resetValue(string $resetValue = '')
    {
        $this->resetValue = $resetValue;
        return $this;
    }
}